Mental Health Analysis
Python • TensorFlow • NLP • Cloud Analytics • Wearables
NLP TensorFlow Predictive Modeling Wearable Data Cloud AI
uploaded file

Project Overview

Problem: Early signs of mental stress or mental illness often go undetected until they escalate.

AI Component: Sentiment analysis, anomaly detection, and predictive modeling analyze behavioral data, text inputs, and physiological signals.

Solution: A cloud-based AI system that correlates text emotions, sleep patterns, heart-rate variability, and activity patterns to detect early risk indicators.

Impact: Helps in early intervention and reduces global mental health crises.

Key Features

  • Real-time sentiment analysis from typed text or voice transcripts
  • Anomaly detection on wearable sensor signals
  • Predictive mood forecasting (next 24–72 hours)
  • Safety alerts and check-in prompts
  • User dashboard + clinician view

No diagnosis — system assists professionals and individuals with insights.

Architecture

  1. Frontend: React app for journaling + mood dashboard
  2. Backend: Python (FastAPI) — ingestion, NLP scoring, signal processing
  3. NLP: TensorFlow sentiment and emotional-tone classifier
  4. Wearables: HRV, sleep, steps, stress metrics via device APIs
  5. Cloud: BigQuery / AWS Redshift for analytics + anomaly detection

Explainable AI modules highlight text patterns or physiological irregularities contributing to alerts.

Sample Dataset — User Profiles

UserIDAgeOccupationRegionLast Check-In
MH100119StudentBangalore2025-11-15
MH100227Software EngineerDelhi2025-11-16
MH100333DesignerMumbai2025-11-14
MH100441TeacherPune2025-11-12

Sample Dataset — Sentiment & Text Analysis

UserIDText EntryEmotionSentiment ScoreRisk Indicator
MH1001"Feeling overwhelmed with exams."Stress-0.62Medium
MH1002"Everything feels pointless this week."Depressive-0.80High
MH1003"Had a productive day, feeling good."Positive0.70Low
MH1004"Not sleeping well lately."Fatigue-0.40Medium

Sample Dataset — Wearable Sensor Metrics

UserIDHRV (ms)Resting HRSleep (hrs)StepsAnomaly
MH100165785.13200Yes
MH100252854.42100Yes
MH100390707.28800No
MH100472746.05100No

Low HRV + poor sleep + negative sentiment often correlates with early stress patterns.

Sample Dataset — Predictive Risk Scores

UserID24h Mood ForecastRisk LevelModel Confidence
MH1001-0.58Medium0.84
MH1002-0.82High0.91
MH10030.65Low0.88
MH1004-0.31Medium0.79

Forecast generated via LSTM TensorFlow model + wearable trend regression.

ML Logs & Explainability

LogIDModelActionTimeFactors
LOG-801NLP-Sentiment-v3Analyze MH1002 text2025-11-16Keywords: "pointless", low energy patterns
LOG-802Wearable-Anomaly-v2HRV anomaly detection2025-11-15HRV=52ms, Sleep=4.4hrs
LOG-803LSTM-Mood-v4Forecast MH1001 mood2025-11-15Recent sentiment ↓, sleep ↓
LOG-804FairnessCheck-v1Cohort bias scan2025-11-14No demographic imbalance detected

Explainable AI helps clinicians understand why a risk alert was triggered.

Ethics & Safety Considerations

Delivered: Full HTML mockup + sample datasets for text, wearables, predictions, and logs. Want: SQL schema • JSON dataset version • React dashboard • API design • TensorFlow model example?